﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Modeling_Sub_Pages_NewsPage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        UniversityDatabaseManagerment udm = new UniversityDatabaseManagerment();

        try
        {
            int id = Convert.ToInt32(Request.QueryString["id"].ToString());
            if (udm.createConnection() != null && udm.showDepartmentByID(udm.createConnection(),id) != null)
            {
                dlEvents.DataSource = udm.showDepartmentByID(udm.createConnection(),id);
                dlEvents.DataBind();

                ProductDataList2.DataSource = udm.showFaculty(udm.createConnection(), id);
                ProductDataList2.DataBind(); 
            }
            else
            {
                Response.Redirect("~/ErrorPage.aspx");
            }
        }
        catch (Exception)
        {
            Response.Redirect("~/ErrorPage.aspx");
        }
    }

    protected void ProductDataList2_PagePropertiesChanged(object sender, EventArgs e)
    {
        ProductDataList2.DataBind(); 
    }
}